package com.cloud.feign;

import com.cloud.config.FeignConfig;
import io.seata.core.exception.TransactionException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;



/**
 * @Author wenbo
 * @Date 2022/12/13 11:06
 **/

@FeignClient(name="provider-server",configuration = FeignConfig.class,fallback = ItemFeignServiceFallback.class)
public interface ItemFeignService {


    @GetMapping("/item/doOrder")
    String doOrder();

    /**
     * 根据用户ID 获取订单
     * @param id
     * @return
     */
    @GetMapping("/item/item/{id}")
    String getItemInfo(@PathVariable(name = "id") String s);


    @GetMapping("/stock/decStock")
    String decStock(@RequestParam Long productId, @RequestParam Long productSpecs);

    @GetMapping("/stock/decStock2")
    String decStock2() throws TransactionException;


}
